package com.woniuxy.service.daily.impl;



import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.dao.BreakMapper;
import com.woniuxy.pojo.Break;
import com.woniuxy.service.daily.BreakService;

@Service
public class BreakServiceImpl implements BreakService{

	@Autowired
	private BreakMapper breakMapper;
	
	@Override
	public PageInfo selectAll(Integer pn, String condition) {
		PageHelper.startPage(pn, 5);
		List<Break> list = breakMapper.selectAll(condition);
		PageInfo pageInfo = new PageInfo(list,3);
		return pageInfo;
	}

	@Override
	public Break selectById(Integer breakId) {
		// TODO Auto-generated method stub
		return breakMapper.selectByPrimaryKey(breakId);
	}

	@Override
	public int deleteBreak(String breakIds) {
		// TODO Auto-generated method stub
		return breakMapper.deleteBreak(breakIds);
	}

	@Override
	public void addBreak(Break breaks) {
		// TODO Auto-generated method stub
		breakMapper.insert(breaks);
	}

	@Override
	public void updateBreak(Break breaks) {
		// TODO Auto-generated method stub
		breakMapper.updateByPrimaryKey(breaks);
	}

}
